package com.tbit.config.payConfig;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * 微信v3配置 - 服务商
 *
 * @author <a href="mailto:zhang.zhiliang@tbit.com.cn">Zhang ZhiLiang</a>
 * @version 1.0
 * @see <a href="http://adsl1.tbit.com.cn:21490/pages/viewpage.action?pageId=82182491">订单号规范</a>
 * @since 2025/2/18
 */
@Data
@Configuration
public class WxMchConfig {

    /** 微信支付服务商的商户号. */
    @Value("${wx_mch_mchId:1664343558}")
    private String mchId;
    /** 证书序列号 */
    @Value("${wx_mch_merchantSerialNumber:59E67ECF1ACA6ACEDF74A4CC245E19C63598FE79}")
    private String merchantSerialNumber;
    /** apiv3 商户apiclient_key.pem路径 */
    @Value("${wx_mch_privateKeyPath:/data/cert/mch/apiclient_key.pem}")
//    @Value("${wx_mch_privateKeyPath:D:\\Documents\\work\\cert\\mch\\apiclient_key.pem}")
    private String privateKeyPath;
    /** apiv3 商户apiclient_cert.pem路径 */
    @Value("${wx_mch_privateCertPath:/data/cert/mch/apiclient_cert.pem}")
//    @Value("${wx_mch_privateCertPath:D:\\Documents\\work\\cert\\mch\\apiclient_cert.pem}")
    private String privateCertPath;
    /**服务商appid*/
    @Value("${wx_mch_appid:wx2871656e2021f65f}")
    private String appId;
    /** 服务商 商户APIV3密钥 */
    @Value("${wx_mch_apiV3Key:tbit74123client36987TBITservices}")
    private String apiV3Key;

    public static WxMchConfig getInstance(){
        WxMchConfig wxMchConfig = new WxMchConfig();
        wxMchConfig.setMchId("1664343558");
        wxMchConfig.setMerchantSerialNumber("59E67ECF1ACA6ACEDF74A4CC245E19C63598FE79");
        wxMchConfig.setPrivateKeyPath("D:\\Documents\\work\\cert\\mch\\apiclient_key.pem");
        wxMchConfig.setPrivateCertPath("D:\\Documents\\work\\cert\\mch\\apiclient_cert.pem");
        wxMchConfig.setAppId("wx2871656e2021f65f");
        wxMchConfig.setApiV3Key("tbit74123client36987TBITservices");
        return wxMchConfig;
    }
}
